import Vue from 'vue'
import App from './App'
import store from './store/index.js'

Vue.config.productionTip = false
Vue.prototype.$eventBus = new Vue()
Vue.prototype.$store = store
const {
	cameraAuthorized,
	bluetoothEnabled,
	batteryLevel,
	locationAuthorized,
	locationEnabled,
	osName,
	screenHeight,
	screenWidth,
	statusBarHeight,
	windowHeight,
	windowWidth,
	platform
} = uni.getSystemInfoSync()
// 获取系统信息 并绑定到vue原型上
Vue.prototype.$sysInfo = {
	cameraAuthorized,
	bluetoothEnabled,
	batteryLevel,
	locationAuthorized,
	locationEnabled,
	osName,
	screenHeight,
	screenWidth,
	statusBarHeight,
	windowHeight,
	windowWidth,
	platform,
	timeOutSecs: 8000 // 门锁超时回复时间
}
// 获取保存在本地的用户信息
Vue.prototype.$userInfo = {
	sessionId: uni.getStorageSync('sessionId') || '',
	openId: uni.getStorageSync('openId') || '',
	mobile: uni.getStorageSync('mobile') || '',
	userId: uni.getStorageSync('userId') || '',
	name: uni.getStorageSync('name') || ''
}
import '@/styles/styles.less' // global css
App.mpType = 'app'

const app = new Vue({
	store,
	...App
})
app.$mount()